home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 July / CHIP 2006-07.2.iso / program / web_gelistirme / easyphp1-7_setup.exe / {app} / phpmyadmin / server_common.inc.php < prev    next >
Encoding:
PHP Script  |  2003-09-07  |  1.1 KB  |  54 lines

  1. <?php
  2. /* $Id: server_common.inc.php,v 1.8 2003/04/17 18:50:38 lem9 Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5. /**
  6.  * Gets some core libraries
  7.  */
  8. if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
  9.     include('./libraries/grab_globals.lib.php');
  10. }
  11. if (!defined('PMA_COMMON_LIB_INCLUDED')) {
  12.     include('./libraries/common.lib.php');
  13. }
  14.  
  15. /**
  16.  * Handles some variables that may have been sent by the calling script
  17.  */
  18. if (isset($db)) {
  19.     unset($db);
  20. }
  21. if (isset($table)) {
  22.     unset($table);
  23. }
  24.  
  25. /**
  26.  * Set parameters for links
  27.  */
  28. $url_query = PMA_generate_common_url();
  29.  
  30. /**
  31.  * Defines the urls to return to in case of error in a sql statement
  32.  */
  33. $err_url = 'main.php' . $url_query;
  34.  
  35. /**
  36.  * Displays the headers
  37.  */
  38. require('./header.inc.php');
  39.  
  40. /**
  41.  * Checks for superuser privileges
  42.  */
  43. // We were checking privileges with 'USE mysql' but users with the global
  44. // priv CREATE TEMPORARY TABLES or LOCK TABLES can do a 'USE mysql'
  45. // (even if they cannot see the tables)
  46.  
  47. $is_superuser = @PMA_mysql_query('SELECT COUNT(*) FROM mysql.user', $userlink);
  48.  
  49. // now, select the mysql db
  50. if ($is_superuser) {
  51.     @PMA_mysql_query('USE mysql', $userlink);
  52. }
  53. ?>
  54.